if (not EmuFox) then
	include('shared.lua')
end

ENT.RenderGroup    = RENDERGROUP_BOTH


function ENT:Initialize()
	self.ScreenWidth = 512
	self.ScreenHeight = 512

	self.NeedRefresh = true
	
	self.GPU = WireGPU(self)
end

function ENT:OnRemove()
	self.GPU:Finalize()
end

usermessage.Hook("hispeed_BGP", function(um)

end)

local floor = math.floor

function ENT:Draw()
	self:DrawModel()
	
	if self.NeedRefresh then
		self.NeedRefresh = false
		
		self.GPU:RenderToGPU(function()

			surface.SetDrawColor( 0,0,0,255)
			surface.DrawRect(0,0, 512,512)
			
			surface.SetDrawColor( 255,0,255,255)
			surface.DrawRect(100,100, 400,400)

		end)
		
	end
	
	if EmuFox then return end
	
	self.GPU:Render()
	Wire_Render(self)
end

function ENT:IsTranslucent()
	return true
end
